<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>优店</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/page.css">
    <script src="../js/jquery-3.2.1.min.js"></script>
    <script src="../js/media.js"></script>
    <script src="../js/common.js"></script>
    <style>
        .Footprints {
            width: .46rem;
            height: .46rem;
            position: fixed;
            bottom: .72rem;
            right: .12rem;
        }
    </style>
</head>

<body>


    <!--正文-->
    <div class="Excellent-shop bc-gray">
        <ul>
            <li v-for='item in data'>
                <div class="top flex">
                    <img :src="item.storeImage" alt="">
                    <div class="center">
                        <p class="t1">{{item.storeName}}</p>
                        <p class="t2">
                            <span>{{item.storeAddress}}</span>
                            <em><font>{{item.storeScore}}</font>分</em>
                        </p>
                    </div>
                    <div class="right" @click='join_shop(this)'>
                        进店
                    </div>
                </div>
                <div class="bottom clearfix">
                    <img :src="items.produceHeadImage" alt="" v-for='items in item.produce_three' @click='link_buy(this)'>
                </div>
            </li>

        </ul>

    </div>

    <script src="../js/vue.js"></script>
    <script src="../js/vue-resource.min.js"></script>

    <script>
        $(function () {
            new Vue({
                el: 'body',
                data: {

                },
                ready: function () {
                    this.$http.get(base_url + 'ZITAOHUI/goodStore').then(
                        function (response) {
                            console.log(response)
                            let all_data = response.data.extend.list;

                            for (let i = 0; i < all_data.length; i++) {
                                let aim = all_data[i].produce
                             
                                all_data[i].produce_three = [aim[0], aim[1], aim[2]]
                                console.log(all_data[i].produce_three);


                            }
                            this.$set('data', all_data)
                            console.log(all_data);
                        },
                        function () {})
                },
                methods: {
    
                    join_shop: function (t) {
                        console.log(t)
                        window.location.href = '../page/Shop.html?s_name=' + t.item.storeName+'&s_id='+ t.item.storeId
                    },
         
                    link_buy:function(t){
                        console.log(t)
                        window.location.href = '../page/buy-info-page.3.html?p_id=' + t.items.produceId
                    }
                }
            })
        })
    </script>
</body>

</html>